<table id="WTM-donate-List"></table>
<script>
  layui.use(['table'],function(){
    const table = layui.table;
    const tableIns = table.render({
      elem: '#WTM-donate-List'
      , url: '/json/donate.js'
      , page: true
      , autoSort: true
      , cols: [[
        { type: 'numbers', fixed: 'left' }
        , { field: 'date', title: '日期', width: 120, sort: true }
        , { field: 'name', title: '姓名', width: 150, sort: true }
        , { field: 'amount', title: '金额', width: 120, sort: true }
        , { field: 'from', title: '来源', width: 60 }
        , { field: 'comment', title: '留言' }
      ]]
      , parseData: function(res){
        var pageIndex = tableIns.config.page.curr===undefined?1:tableIns.config.page.curr;
        var result = res.Data.slice(tableIns.config.limit*(pageIndex-1),tableIns.config.limit*pageIndex);
        return {
                "Code": 200,
                "Msg":"",
                "Count": res.Data.length,
                "Data": result
              }
      }
      , skin: 'line'
      , height: 'full-110'
    });
  })
</script>
